package com.crr.controller;

import com.crr.common.bean.ResultBean;
import com.crr.common.controller.BaseController;
import com.crr.service.DictService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;
@RestController
@Api(tags = "字典管理")
@RequestMapping("/v1")
public class DictController extends BaseController {
    @Autowired
    DictService dictService;
    @ApiOperation("根据类型查询")
    @GetMapping("/dict/type")
    public ResultBean queryDict(@RequestParam(name = "type",required = true) String type){
        List<Map> list = dictService.queryDictByType(type);
        return success("字典查询",list);
    }
}
